package com.hspedu.extends_.exercise;

/**
 * @Author Stringzhua
 * @Date 2024/3/1 21:45
 * description:
 */
public class NodePad extends Computer {
    private String color;

    public NodePad(String cpu, int memory, int disk, String color) {
        super(cpu, memory, disk);
        this.color = color;
    }

    public String getColor() {
        return color;
    }

    public void setColor(String color) {
        this.color = color;
    }

    //打印notepad的信息
    public void printnotepadInfo() {
        System.out.println("===notepad信息如下===");
        //子类不能直接访问父类的私有属性
//        System.out.println("getCpu() = " + getCpu()+" getMemory()="+getMemory()+" getDisk="+getDisk());
        //调用父类的getDetails来得到父类的相关属性
        System.out.println("getDetails() = " + getDetails() + " color=" + color);
    }
}
